package com.atguigu;

import java.util.concurrent.atomic.AtomicInteger;

/*
CAS是比较并交换
* */
public class CASDemo {
    public static void main(String[] args) {
        AtomicInteger atomicInteger = new AtomicInteger(5);
        System.err.println(atomicInteger.compareAndSet(5, 2019)+"\t current data:"+atomicInteger.get());
        System.err.println(atomicInteger.compareAndSet(5, 1024)+"\t current data:"+atomicInteger.get());
        atomicInteger.getAndIncrement();
        System.out.println("我是吴旭");
        System.err.println("李晗再次提交");

        Order order = new Order();
    }
}
